package com.aliyun.order.client.service;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import com.aliyun.commons.model.Result;
import com.aliyun.order.client.model.CreateOrderRequest;
import com.aliyun.order.client.model.OrderDetailDTO;
import org.springframework.validation.annotation.Validated;

/**
 * 商品服务
 *
 * 
 * @date 2024/11/27
 */
@Validated
public interface OrderService {

    /**
     * 创建订单
     *
     * @param request 请求
     * @return {@link Result }<{@link Long }>
     */
    Result<Long> createOrder(@NotNull(message = "创建订单入参不能为空") @Valid CreateOrderRequest request);

    /**
     * 获取订单详细信息
     *
     * @param orderId 订单 ID
     * @return {@link Result }<{@link OrderDetailDTO }>
     */
    Result<OrderDetailDTO> getOrderDetail(@Min(value = 1, message = "订单ID无效") long orderId);
}